﻿using System;

namespace NetMicro.Cache.DelayBus
{
    /// <summary>
    /// 延迟队列事件
    /// </summary>
    public class EventJob
    {
        /// <summary>
        /// 保证全局唯一
        /// </summary>
        public virtual string JobId { get; set; } = Guid.NewGuid().ToString();

        /// <summary>
        /// 主题
        /// </summary>
        public virtual string Topic { get; set; }

        /// <summary>
        /// 延迟时间
        /// </summary>
        public virtual TimeSpan Delay { get; set; }

        /// <summary>
        /// 默认消息处理时间（5秒）
        /// </summary>
        public virtual TimeSpan TTR { get; set; } = TimeSpan.FromSeconds(300);

        /// <summary>
        /// 数据主体
        /// </summary>
        public virtual string Body { get; set; }
    }
}
